/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package alcatraz.client;

import alcatraz.common.IAlcatraz;
import java.util.ResourceBundle;

/**
 *
 * @author andreas
 */
public final class ClientConfig implements IAlcatraz {

    private static ResourceBundle rb = null;
    private static int addrIdx = 0;
    private static String mode = READ;

    private static final String SERVER_ADDRESS = "server.address";

    private ClientConfig() {
        // hide constructor
    }

    static {
        try {
            rb = ResourceBundle.getBundle("clientcfg");
        } catch (Exception e) {
            //TODO: perform exception
        }
    }

    public static void open(String mode) {
        addrIdx = 0;
        if(!WRITE.equals(mode) && !READ.equals(mode)) {
            ClientConfig.mode = READ;
        } else {
            ClientConfig.mode = mode;
        }
    }

    public static void close() {
        if(WRITE.equals(mode)) {
            while (addrIdx < MAX_SELECTED_SERVER_ADDR) {
                String assignAddr = SERVER_ADDRESS.concat(".").concat(String.valueOf(addrIdx));
            }
        }
    }

}
